package cn.cheln.explorer.cpnt.adapter;

import android.content.Context;
import android.database.Cursor;
import android.view.View;
import android.widget.TextView;
import cn.cheln.explorer.beans.ApkInfo;
import cn.cheln.explorer.beans.FileInfo;
import cn.cheln.explorer.beans.MusicInfo;
import cn.cheln.support.ui.DensityUtil;
import cn.cheln.support.ui.adapter.ItemDataSrc;
import cn.cheln.support.ui.adapter.MapAdapter.AdaptInfo;
import java.util.Comparator;
import java.util.Map;
import java.util.TreeMap;

public class CountAdapter extends FileAdapter
{
  Cursor cursorTmp;
  int density105 = DensityUtil.dip2px(this.context, 105.0F);
  int density260 = DensityUtil.dip2px(this.context, 260.0F);
  public Map<Integer, Object> items = new TreeMap(new Comparator()
  {
    public int compare(Integer paramInteger1, Integer paramInteger2)
    {
      return (paramInteger1.intValue() - paramInteger2.intValue());
    }
  });

  public CountAdapter(Context paramContext, MapAdapter.AdaptInfo paramAdaptInfo)
  {
    super(paramContext, paramAdaptInfo);
  }

  public Object getItem(int paramInt)
  {
    if (!(this.items.containsKey(Integer.valueOf(paramInt))))
      this.items.put(Integer.valueOf(paramInt), super.getItem(paramInt));
    Object localObject = this.items.get(Integer.valueOf(paramInt));
    if (localObject == null)
      localObject = null;
    return localObject;
  }

  public FileInfo getSimpleFileItem(int paramInt)
  {
    try
    {
      this.cursorTmp = ((Cursor)getItemDataSrc().getContent());
      this.cursorTmp.moveToPosition(paramInt);
      FileInfo localFileInfo = new FileInfo(this.cursorTmp.getString(this.cursorTmp.getColumnIndex("_data")));
      return localFileInfo;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    return null;
  }

  protected FileInfo getThumbnailBase(FileInfo paramFileInfo)
  {
    if ((paramFileInfo instanceof MusicInfo) && (((MusicInfo)paramFileInfo).thumbnail != null))
      paramFileInfo.thumbnailPath = ((MusicInfo)paramFileInfo).thumbnail;
    return paramFileInfo;
  }

  protected void getViewInDetail(Object paramObject, int paramInt, View paramView)
  {
    TextView localTextView;
    super.getViewInDetail(paramObject, paramInt, paramView);
    View localView = paramView.findViewById(2131230805);
    if (localView != null)
    {
      localTextView = (TextView)localView;
      if (!(paramObject instanceof ApkInfo))
        break label48;
    }
    for (int i = this.density105; ; i = this.density260)
    {
      localTextView.setMaxWidth(i);
      label48: return;
    }
  }

  public void setItemDataSrc(ItemDataSrc paramItemDataSrc)
  {
    this.items.clear();
    super.setItemDataSrc(paramItemDataSrc);
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     cn.cheln.explorer.cpnt.adapter.CountAdapter
 * JD-Core Version:    0.5.2
 */